const tryCatch = (controller) => {
    return async (req, res, next) => {
        try {
            let result = await controller(req, res);
            return result;
        } catch (err) {
            console.error("err", err);
            next(err);
        }
    }
}
module.exports = tryCatch